<load target="js/member_admin_group.js" />
<script>
	xe.lang.groupDeleteMessage = '{$lang->msg_group_delete}';
	xe.lang.multilingual = '{$lang->cmd_set_multilingual}';
	xe.lang.modify = '{$lang->cmd_modify}';
	xe.lang.deleteMSG = '{$lang->cmd_delete}';
</script>
<style>
	._imageMarkButton img { max-height:16px }
	.filebox_item{max-height:16px}
</style>
<div class="x_page-header">
	<h1>{$lang->member_group} <a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_member_group" target="_blank">{$lang->help}</a></h1>
</div>
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/member/tpl/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
	<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form action="" method="post" ruleset="insertGroupConfig">
	<input type="hidden" name="module" value="member" />
	<input type="hidden" name="act" value="procMemberAdminGroupConfig" />
	<input type="hidden" name="xe_validator_id" value="modules/member/tpl/1" />
	<table class="sortable x_table x_table-striped x_table-hover">
		<caption>
			<strong>{count($group_list)}{$lang->msg_groups_exist}</strong>
			<span class="x_pull-right" style="position:relative;top:7px">
				{$lang->use_group_image_mark}: 
				<label for="yes" class="x_inline"><input type="radio" name="group_image_mark" id="yes" value="Y" checked="checked"|cond="$config->group_image_mark == 'Y'" /> {$lang->cmd_yes}</label>
				<label for="no" class="x_inline"><input type="radio" name="group_image_mark" id="no" value="N" checked="checked"|cond="$config->group_image_mark != 'Y'" /> {$lang->cmd_no}</label>
			</span>
		</caption>
		<thead>
			<tr>
				<th scope="col"><em style="color:red">*</em> {$lang->group_title}</th>
				<th scope="col">{$lang->description}</th>
				<th scope="col">{$lang->default_group}</th>
				<th scope="col" class="_imageMarkButton">{$lang->group_image_mark}</th>
				<th scope="col"></th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td class="_imageMarkButton">&nbsp;</td>
				<td><a href="#" class="_addGroup">{$lang->cmd_add}</a></td>
			</tr>
		</tfoot>
		<tbody class="uDrag _groupList">
			<tr loop="$group_list=>$group_srl,$group_info">
				<td>
					<div class="wrap">
						<button type="button" class="dragBtn">Move to</button>
						<input type="hidden" name="group_srls[]" value="{$group_info->group_srl}" />
						<input type="text" name="group_titles[]" value="{htmlspecialchars($group_info->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}" class="lang_code" title="{$lang->group_title}" />
						<a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_faq_administrator" target="_blank" cond="$group_info->title == '관리그룹'">{$lang->help}</a>
					</div>
				</td>
				<td><input type="text" name="descriptions[]" value="{$group_info->description}" title="{$lang->description}" /></td>
				<td><input type="radio" name="defaultGroup" value="{$group_info->group_srl}" title="Default" checked="checked"|cond="$group_info->is_default=='Y'" /></td>
				<td class="_imageMarkButton">
					<input type="hidden" name="image_marks[]" value="{$group_info->image_mark}" class="_imgMarkHidden" />
					<img src="{$group_info->image_mark}" alt="{htmlspecialchars($group_info->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}" cond="$config->group_image_mark == 'Y' && $group_info->image_mark" />
					<a href="#imageMark" class="modalAnchor _imageMark filebox">{$lang->cmd_modify}</a>
				</td>
				<td><div class="_deleteTD" style="display:none"|cond="$group_info->is_default == 'Y'"><a href="#{$group_srl}" class="_deleteGroup">{$lang->cmd_delete}</a></div></td>
			</tr>
			<tr style="display:none" class="_template">
				<td>
					<div class="wrap">
						<button type="button" class="dragBtn">Move to</button>
						<input type="hidden" name="group_srls[]" value="new" disabled="disabled"/>
						<input type="text" name="group_titles[]" value=""  disabled="disabled" class="lang_code" />
					</div>
				</td>
				<td><input type="text" name="descriptions[]" value="" disabled="disabled" /></td>
				<td><input type="radio" name="defaultGroup" value="" title="Default" disabled="disabled" /></td>
				<td class="_imageMarkButton"><input type="hidden" name="image_marks[]" value="" class="_imgMarkHidden" disabled="disabled" />
					<a href="#imageMark" class="modalAnchor _imageMark filebox">{$lang->cmd_modify}</a></td>
				<td><div class="_deleteTD"><a href="#new" class="_deleteGroup">{$lang->cmd_delete}</a></div></td>
			</tr>

		</tbody>
	</table>
	<div class="x_clearfix">
		<span class="x_pull-right"><input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_save}" /></span>
	</div>
</form>

<section class="x_modal" id="imageMark">
	<div class="x_modal-header">
		<h1>{$lang->group_image_mark} {$lang->cmd_setup}</h1>
	</div>
	<div class="x_modal-body">
		<block cond="$fileBoxList">
			<p>{$lang->usable_group_image_mark_list}</p>
			<div class="filebox_list">
			</div>
		</block>
	</div>
	<div class="x_modal-footer">
		<button type="button" class="x_btn x_pull-left" data-hide="#exModal-1">Close</button>
		<p class="x_pull-right">{$lang->add_group_image_mark}: <a href="{getUrl('', 'module','admin', 'act', 'dispModuleAdminFileBox')}" target="_blank">{$lang->link_file_box}</a></p>
	</div>
</section>
